import { Module, DynamicModule } from '@nestjs/common';
import { ElasticsearchModule, ElasticsearchModuleOptions } from '@nestjs/elasticsearch';
import { elasticseach } from './defaultconfig';


@Module({})
export class  ElasticModule{
  static  forRoot(ParamValue:()=>ElasticsearchModuleOptions):DynamicModule{
        return {
        global:true,
        module:ElasticsearchModule,
        imports:[ElasticsearchModule.register(ParamValue())],
        exports:[ElasticsearchModule]

        }
    }
}